﻿<%@ Page Language="C#"  MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="SearchMovieTimeTable.aspx.cs" Inherits="OnlineMovieTicket.WebForms.BuyTicket.SearchMovieTimeTable" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ctpHead" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ctpBody" runat="server">
<link rel="Stylesheet" type="text/css" href="../Styles/gv2007.css" />
<link href="../Styles/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Scripts/jquery-1.4.2.js" ></script>      
<script type="text/javascript" src="../Scripts/ui/jquery.ui.core.js"></script> 
<script type="text/javascript" src="../Scripts/ui/jquery.ui.widget.js"></script> 
<script type="text/javascript" src="../Scripts/ui/jquery.ui.datepicker.js"></script>      
<script type="text/javascript">
      $(function () {          
          var date = $('#<%= txtShowingDate.ClientID %>').datepicker({ dateFormat: 'dd-MM-yy' });
    })
</script> 

<table width="980px" cellpadding="6" cellspacing="6" class="pageBackGround" >
<tr><td>
   <h2 class="fontWhite">BUY TICKET</h2>
    <asp:Panel ID="Panel1" runat="server" GroupingText="Cinema & Movie Information" 
        CssClass="fontWhite" Font-Bold="True">
            <table class="fontWhite" cellpadding="6" cellspacing="6">   
                <tr><td height="5px">                    
                    </td></tr>    
                    <tr><td>
                        <table width="100%" cellpadding="6" cellspacing="6">
                                <tr class="trGrid">
                                    <td width="100px">Cinema
                                    </td>
                                    <td>:</td>
                                    <td>
                                    <asp:DropDownList ID="ddlCinemas" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                    </tr>
                                    <tr>
                                    <td>
                                    Movie
                                    </td>
                                    <td>:</td>
                                    <td>
                                    <asp:DropDownList ID="ddlMovies" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                    </tr>
                                    <tr>
                                    <td>
                                    Showing Date
                                    </td>
                                    <td>:</td>
                                    <td>
                                        <asp:TextBox ID="txtShowingDate" runat="server"></asp:TextBox>
                                    </td>
                                    </tr>
                                    <tr>
                                    <td colspan="3">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search"  class="btn"
                                            onclick="btnSearch_Click" />
                                    </td>
                                    <td>
                                    </td>
                                    </tr>
                            </table>
                    </td></tr>     
               
                <tr><td>
                    <table width="600px" bgcolor="black" cellpadding="6">
                             <% List<OnlineMovieTicket.Model.TransactionDetail> transactionList = (List<OnlineMovieTicket.Model.TransactionDetail>)ViewState["TransList"]; %>
                                <% foreach (var item in transactionList ) { %>
    
                                    <tr bgcolor="#767056">
                                        <td>
                                            <% Response.Write(item.CinemasName); %>   
                                        </td>     
                                    </tr>    
                                    <tr bgcolor="#cc9900">
                                        <td>
                                            <table>
                                            <% if (item.Movies != null)
                                               { %>
                                            <% foreach (var movie in item.Movies)
                                               {%>   
                                               <tr>
                                                <td>                   
                                                    <% Response.Write(movie.MovieName); %>
                                                </td>
                                                <td width="50px"></td>
                                                <% foreach (var showtime in movie.startTimeList)
                                                   { %>
                                                   <td>
                                                       <a href="./SelectTicket.aspx?movieAssignId=<% Response.Write(showtime.MovieAssignmentID); %>"><% Response.Write(String.Format("{0:HH:mm:ss}", showtime.StartTime)); %></a>
                                                   </td>
                                                <%} %>
                                               </tr>
                                            <%} %>
                                            <%} %>
                                            </table>
                                        </td>
                                    </tr>
                                <% } %>           
                     </table>
                </td></tr>  
               
            </table>
     </asp:Panel>
</td></tr>
</table>
</asp:Content>
